Repository navigation
Conversation
Follow-up to #2257. Two modules in `metro` import its own types as `metro/private/DeltaBundler/types`, and `metro-minify-terser`'s test imports `BasicSourceMap` from `metro-source-map`, which the package doesn't depend on. Both resolve only through Yarn's hoisted `node_modules`, so Flow can't find them under an isolated layout such as pnpm's. Import `metro`'s types relatively, and take the test's map type from the `MinifierOptions` it already imports. Changelog: Internal
robhogan
added a commit
that referenced
this pull request
Nov 21, 2026
Metro is developed with Yarn v1 and `yarn.lock` stays the source of truth, but this lets pnpm users work in the repo by generating a lockfile with `pnpm import`. It adds a `pnpm-workspace.yaml` (pnpm doesn't read `workspaces` from `package.json`), git-ignores the generated `pnpm-lock.yaml` and documents the two commands in the README. The workspace file also sets two things. `linkWorkspacePackages` - without it, pnpm (since v9) resolves our exact-version internal dependencies like `"metro-core": "0.88.0"` from npm, which fails after a version bump that isn't published yet. `allowBuilds` declines `core-js-pure`'s postinstall (a funding banner) - otherwise pnpm 11+ fails the install with `ERR_PNPM_IGNORED_BUILDS`. Linking workspace packages gives each one its own `node_modules` pointing at its siblings, where Yarn hoists them. Those links form cycles (`packages/metro-config/node_modules/metro` -> `packages/metro`, whose `node_modules/metro-config` links back), which Flow crawls without hanging since 0.341.0, and with #2257 and #2267 no type imports rely on hoisting, so Flow needs no config changes. Changelog: Internal Test plan: On a fresh clone of this PR, with each of pnpm 11.28.12 and 12.21.0, `pnpm import` then `pnpm install --frozen-lockfile` succeed, `packages/metro/node_modules/metro-core` is a symlink to `../../metro-core`, and `pnpm exec jest --no-watchman packages` passes (167 suites, 3262 tests), as do `build`, `lint`, `format-check`, `verify-api-snapshots`, `typecheck-ts` and `test-smoke`. `flow check` passes under pnpm 12.15.0 and under Yarn. Without `allowBuilds`, `pnpm install` exits 1 on both versions.
Collaborator
Author
|
Folded into #2257. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2257. Two modules in
metroimport its own types asmetro/private/DeltaBundler/types, andmetro-minify-terser's test importsBasicSourceMapfrommetro-source-map, which the package doesn't depend on. Both resolve only through Yarn's hoistednode_modules, so Flow can't find them under an isolated layout such as pnpm's. Importmetro's types relatively, and take the test's map type from theMinifierOptionsit already imports.Changelog: Internal
Test plan:
Under pnpm (with #2110 on top),
flow checkwith the existingname_mapperfails with 3 unresolved imports on #2257 and passes with this. Under Yarn it still passes.jest packages/metro-minify-terser packages/metro/src/ModuleGraph,lint,verify-api-snapshotsandtypecheck-tspass.